import {redirect} from "react-router-dom";
import  api from "@/api/index.js"

export  default async function acticleDeleteAction({params}){
    const {slug} = params;
    const response = await api.article.deteleArticle(slug);
    if(response && response.status !==1){
        throw new Error(response.message) // 给错误页面捕获
    }
    return redirect('/')
}